'''
requests 模块：
    作用：发送http请求


'''
import requests

#---------------------------发送get请求---------------------------
head ={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0"}
data = {"username:":"abc","password:":"123123"}
#res = requests.get(url="http://www.baidu.com",headers=head,data=data)
res = requests.post(url="http://www.baidu.com",headers=head,data=data)
#headers="" 伪装首部 ,可以在浏览器中查看
print(res)
print(res.status_code) # 单独查看状态码
print(res.text)
print("----------"*8)

#---------------------------发送和post请求------------------------------

print(res.text)